home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 67 / IOPROG_67A.ISO / soft / Tools / mwsppv4.exe / INSERT INDEXEDLINESET.SCRIPT < prev    next >
Encoding:
Text File  |  1998-02-13  |  1.4 KB  |  50 lines

  1. !!Script
  2. // Copyright ⌐ 1997-1998 - Modelworks Software
  3.  
  4. /**
  5. @Tool: insert IndexedLineSet~inserts the IndexedLineSet node. The IndexedLineSet node 
  6. represents a 3D geometry formed by constructing polylines from 3D vertices 
  7. specified in the coord field. 
  8. @EndTool: 
  9. @Summary: insert IndexedLineSet~inserts the IndexedLineSet node
  10. */
  11.  
  12. var Node = 
  13. "IndexedLineSet {" +
  14. "\n\t                           # set_colorIndex eventIn MFInt32" + 
  15. "\n\t                           # set_coordIndex eventIn MFInt32" + 
  16. "\n\tcolor             NULL     # exposedField  SFNode" + 
  17. "\n\tcoord             NULL     # exposedField  SFNode" + 
  18. "\n\tcolorIndex                 # field         MFInt32" + 
  19. "\n\t[" +
  20. "\n\t\t" +
  21. "\n\t]" +
  22. "\n\tcolorPerVertex    TRUE     # field         SFBool" + 
  23. "\n\tcoordIndex                 # field         MFInt32" + 
  24. "\n\t[" +
  25. "\n\t\t" +
  26. "\n\t]" +
  27. "\n}" +
  28. "\n@Caret";
  29.  
  30. function DoCommand()
  31. {
  32.   var textUtilities = getScriptObject("Library\\textUtilities.script");
  33.   if (textUtilities)
  34.   {
  35.     var editor = getActiveEditor();
  36.     if (editor)
  37.     {
  38.       var lineIndex = textUtilities.InsertString(editor, Node);
  39.       
  40.       // Now replace @Caret with the real caret
  41.       var range = editor.findFirst("@Caret", lineIndex, 0);
  42.       editor.replace("", range);
  43.       editor.setActive("Insert IndexedLineSet Node");
  44.     }
  45.   }
  46. }
  47.  
  48. !!/Script
  49.  
  50.